package file;

import java.io.File;

public class DeleteFile {
    public static void main(String[] args) {

        //将当前目录下的test.txt文件删除
       File file=new File("demo");
       if( file.exists()) {
           file.delete();
           System.out.println("该文件已删除！");
       }else{
           System.out.println("该目录不存在！");
       }
    }
}


